package com.common.help.test07;

public class Test3 {

	public static void main(String[] args) {
		Music.main(args);
	}
}
class Instrument3 {
	  public void play() {
	    System.out.println("Instrument3.play()");
	  }
	  public String what() {	
	    return "Instrument3";
	  }
	  public void adjust() {}
	}

	class Wind3 extends Instrument3 {
	  public void play() {
	    System.out.println("Wind3.play()");
	  }
	  public String what() { return "Wind3"; }
	  public void adjust() {}
	}

	class Percussion3 extends Instrument3 {
	  public void play() {
	    System.out.println("Percussion3.play()");
	  }
	  public String what() { return "Percussion3"; }
	  public void adjust() {}
	}

	class Stringed3 extends Instrument3 {
	  public void play() {
	    System.out.println("Stringed3.play()");
	  }
	  public String what() { return "Stringed3"; }
	  public void adjust() {}
	}

	class Brass3 extends Wind3 {
	  public void play() {
	    System.out.println("Brass3.play()");
	  }
	  public void adjust() {
	    System.out.println("Brass3.adjust()");
	  }
	}

	class Woodwind3 extends Wind3 {
	  public void play() {
	    System.out.println("Woodwind3.play()");
	  }
	  public String what() { return "Woodwind3"; }
	}

	class Music{
		
		static void instrument(Instrument3 i){
			i.play();
		}
		
		static void get(Instrument3[] e){
			for(Instrument3 e1 : e){
				instrument(e1);
			}
		}
		public static void main(String[] args) {
			Instrument3[] hh = new Instrument3[5];
			int i=0;
			hh[i++] = new Instrument3();
			hh[i++] = new Wind3();
			hh[i++] = new Stringed3();
			hh[i++] = new Brass3();
			hh[i++] = new Woodwind3();
			get(hh);
		}
	}